package net.lookyou.boot.demo.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.lookyou.boot.demo.common.BaseEntity;

import java.io.Serializable;

/**
 * <p>  系统管理-用户基础信息表 </p>
 *
 * @author: zhengqing
 * @date: 2019-08-19
 */
@Data
@TableName("sys_user")
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity<SysUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
    /**
     * 账号
     */
	@TableField("username")
	private String username;
    /**
     * 登录密码
     */
	@TableField("password")
	private String password;

	/**
	 * 手机号
	 */
	@TableField("phone")
	private String phone;

	/**
	 * 盐
	 */
	@TableField("salt")
	private String salt;

	/**
	 * token
	 */
	@TableField("token")
	private String token;

	//不参与持久化
	@TableField(exist = false)
	private String code;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}
